import { createI18n } from 'vue-i18n'
import { message } from './getMessage'

const localeData = {
  legacy: false,
  globalInjection: true,
  locale: 'jp',
  messages: message,
  t(key) {
    console.log('index-t:', key)
    return this.messages[this.locale.value][key]
  },
}

export function setupI18n(app) {
  const i18n = createI18n(localeData)
  app.use(i18n)
}
